package models

import "time"

type SeedlingRecord struct {
	// 出苗记录ID
	ID int `gorm:"column:id;PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
	// 出苗记录创建时间
	CreatedAt *time.Time `gorm:"column:created_at;type:timestamp" json:"created_at"`
	// 出苗记录更新时间
	UpdatedAt *time.Time `gorm:"column:updated_at;type:timestamp" json:"updated_at"`

	SeedlingRecordCore
}

type SeedlingRecordCore struct {
	// 订单ID
	OrderID int `gorm:"column:order_id" json:"order_id"`
	// 大棚ID
	GreenhouseID int `gorm:"column:greenhouse_id" json:"greenhouse_id"`
	// 出苗日期 2006-01-02 日期
	SeedlingDate string `gorm:"column:seedling_date;type:date" json:"seedling_date"`
	// 出苗数量
	Quantity int `gorm:"column:quantity" json:"quantity"`
	// 出苗盘数
	TrayNumber int `gorm:"column:tray_number" json:"tray_number"`
	// 每盘数量
	UnitNumber int `gorm:"column:unit_number" json:"unit_number"`
	// 司机电话
	DriverPhone string `gorm:"column:driver_phone" json:"driver_phone"`
	// 司机姓名
	DriverName string `gorm:"column:driver_name" json:"driver_name"`
	// 发货款
	DeliveryFee float64 `gorm:"column:delivery_fee" json:"delivery_fee"`
	// 付款方式:1自提,2货到付款,3先付款后发货,4货到付款已付
	PaymentMethod int `gorm:"column:payment_method" json:"payment_method"`
	// 送货地址
	DeliveryAddress string `gorm:"column:delivery_address" json:"delivery_address"`
	// 备注
	Remark string `gorm:"column:remark" json:"remark"`
}

type SeedlingRecordDetail struct {
	SeedlingRecord

	// 订单名称
	OrderName string `gorm:"column:orders_name" json:"orders_name"`
	// 大棚名称
	GreenhouseName string `gorm:"column:greenhouse_name" json:"greenhouse_name"`
}

type SeedlingRecordDelta struct {
	// 订单ID
	OrderID interface{} `gorm:"column:order_id" json:"order_id" swaggertype:"integer"`
	// 大棚ID
	GreenhouseID interface{} `gorm:"column:greenhouse_id" json:"greenhouse_id" swaggertype:"integer"`
	// 出苗日期 2006-01-02 日期
	SeedlingDate interface{} `gorm:"column:seedling_date" json:"seedling_date" swaggertype:"string"`
	//	出苗数量
	Quantity interface{} `gorm:"column:quantity" json:"quantity" swaggertype:"integer"`
	//	出苗盘数
	TrayNumber interface{} `gorm:"column:tray_number" json:"tray_number" swaggertype:"integer"`
	//	每盘数量
	UnitNumber interface{} `gorm:"column:unit_number" json:"unit_number" swaggertype:"integer"`
	// 司机电话
	DriverPhone interface{} `gorm:"column:driver_phone" json:"driver_phone" swaggertype:"string"`
	//	司机姓名
	DriverName interface{} `gorm:"column:driver_name" json:"driver_name" swaggertype:"string"`
	// 发货款
	DeliveryFee interface{} `gorm:"column:delivery_fee" json:"delivery_fee" swaggertype:"number"`
	// 付款方式:1自提,2货到付款,3先付款后发货,4货到付款已付
	PaymentMethod interface{} `gorm:"column:payment_method" json:"payment_method" swaggertype:"integer"`
	// 送货地址
	DeliveryAddress interface{} `gorm:"column:delivery_address" json:"delivery_address" swaggertype:"string"`
	// 备注
	Remark interface{} `gorm:"column:remark" json:"remark" swaggertype:"string"`
}

func (SeedlingRecord) TableName() string {
	return "seedling_record"
}
